package com.zhu.library_management_system.repository;

import com.zhu.library_management_system.pojo.User;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface UserRepository extends PagingAndSortingRepository<User,Integer> {

    @Query("SELECT u FROM User u WHERE u.name = ?1 AND u.password = ?2")
    User Login(String name, Integer password);

    @Query("SELECT u FROM User u WHERE u.name = ?1")
    User register(String name);
}
